package com.awspaas.user.apps.processforsap;

import com.actionsoft.bpms.bo.engine.BO;
import com.actionsoft.bpms.schedule.IJob;
import com.actionsoft.sdk.local.SDK;
import com.alipay.sofa.common.profile.StringUtil;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.util.List;

public class FI004Job implements IJob {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        List<BO> list = SDK.getBOAPI().query("BO_EU_FI_PMWH").list();
        for (BO bo:list){
            for (int i=1;i<=21;i++){
                String xh = bo.getString("XH"+i);
                if (StringUtil.isNotEmpty(xh)){
                    BO bo1 = new BO();
                    bo1.set("XH",xh);
                    SDK.getBOAPI().create("BO_EU_FI_XH",bo1,bo.getBindId(),"admin");
                }
            }
        }
    }
}
